import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: HomeView,
        // 设置重定向路径为 '/sys-admin/index'
        redirect: '/sys-admin/index',
        // 配置嵌套路由
        children: [
            //=======================================临时页面的相关路由==========================================
            {
                path: '/sys-admin/index',
                component: () => import( '../views/sys-admin/SystemAdminIndex.vue')
            },
            {
                path: '/sys-admin/temp/admin/add-new',
                component: () => import( '../views/sys-admin/temp/AdminAddNewView.vue')
            },
            {
                path: '/sys-admin/temp/admin/list',
                component: () => import( '../views/sys-admin/temp/AdminListView.vue')
            },
            {
                path: '/sys-admin/temp/album/add-new',
                component: () => import( '../views/sys-admin/temp/AlbumAddNewView.vue')
            },
            {
                path: '/sys-admin/temp/album/list',
                component: () => import( '../views/sys-admin/temp/AlbumListView.vue')
            },
            {
                path: '/sys-admin/temp/category/add-new',
                component: () => import( '../views/sys-admin/temp/CategoryAddNewView.vue')
            },
            {
                path: '/sys-admin/temp/category/category-by-list',
                component: () => import( '../views/sys-admin/temp/CategoryListView.vue')
            },
            {
                path: '/sys-admin/temp/brand/add-new',
                component: () => import( '../views/sys-admin/temp/BrandAddNewView.vue')
            },

            // =======================================商品的相关路由==========================================
            {
                path: '/sys-admin/product/spu/add-new-1',
                component: () => import( '../views/sys-admin/product/SpuAddNewView1.vue')
            },
            {
                path: '/sys-admin/product/spu/add-new-2',
                component: () => import( '../views/sys-admin/product/SpuAddNewView2.vue')
            },
            {
                path: '/sys-admin/product/spu/add-new-3',
                component: () => import( '../views/sys-admin/product/SpuAddNewView3.vue')
            },
            {
                path: '/sys-admin/product/spu/add-new-4',
                component: () => import( '../views/sys-admin/product/SpuAddNewView4.vue')
            },
        ]
    },
    {
        /**
         * 登录
         */
        path: '/login',
        component: () => import( '../views/LoginView.vue')
    },
	
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
